package com.baibei.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * 产品信息
 * Created by ChenRui on 2017/8/3 0003 14:51.
 */
public class ProductInfo implements Parcelable {
    /**
     * 状态
     */
    private String repertoryStatus;

    private String productId; //商品编号
    private String name;//商品名称
    private String area;// 产区
    private String productPic;//商品图
    @SerializedName("detailPic")
    private String productDetails;//商品详情图
    private long remainCount;//剩余数量
    @SerializedName("upCount")
    private long totalCount;//总数量
    private double price;//定金
    private double fee;//订货服务费

    public String getQuoteName() {
        return quoteName;
    }

    public void setQuoteName(String quoteName) {
        this.quoteName = quoteName;
    }

    private String quoteName;  //商品名称2

    private double lastPrice;// 行情价格

    public String getTicketId() {
        return ticketId;
    }

    public void setTicketId(String ticketId) {
        this.ticketId = ticketId;
    }

    private String ticketId;


    public String getClosePrice() {
        return closeprice;
    }

    public void setClosePrice(String closePrice) {
        this.closeprice = closePrice;
    }

    private String closeprice;// 关市价格
    private boolean ischecked;
    private int shipmentPosition; // 所属船的索引

    public boolean isIschecked() {
        return ischecked;
    }

    public void setIschecked(boolean ischecked) {
        this.ischecked = ischecked;
    }

    @Override
    public String toString() {
        return "ProductInfo{" +
                "repertoryStatus='" + repertoryStatus + '\'' +
                ", productId='" + productId + '\'' +
                ", name='" + name + '\'' +
                ", area='" + area + '\'' +
                ", productPic='" + productPic + '\'' +
                ", productDetails='" + productDetails + '\'' +
                ", remainCount=" + remainCount +
                ", totalCount=" + totalCount +
                ", price=" + price +
                ", fee=" + fee +
                ", quoteName='" + quoteName + '\'' +
                ", lastPrice=" + lastPrice +
                ", ticketId='" + ticketId + '\'' +
                ", closeprice='" + closeprice + '\'' +
                ", ischecked=" + ischecked +
                ", shipmentPosition=" + shipmentPosition +
                '}';
    }

    public String getRepertoryStatus() {
        return repertoryStatus;
    }

    public void setRepertoryStatus(String repertoryStatus) {
        this.repertoryStatus = repertoryStatus;
    }

    public int getShipmentPosition() {
        return shipmentPosition;
    }

    public void setShipmentPosition(int shipmentPosition) {
        this.shipmentPosition = shipmentPosition;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getProductPic() {
        return productPic;
    }

    public void setProductPic(String productPic) {
        this.productPic = productPic;
    }

    public String getProductDetails() {
        return productDetails;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public void setProductDetails(String productDetails) {
        this.productDetails = productDetails;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public double getFee() {
        return fee;
    }

    public void setFee(double fee) {
        this.fee = fee;
    }

    public long getRemainCount() {
        return remainCount;
    }

    public void setRemainCount(long remainCount) {
        this.remainCount = remainCount;
    }

    public double getLastPrice() {
        return lastPrice;
    }

    public void setLastPrice(double lastPrice) {
        this.lastPrice = lastPrice;
    }

    public ProductInfo() {
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.repertoryStatus);
        dest.writeString(this.productId);
        dest.writeString(this.name);
        dest.writeString(this.area);
        dest.writeString(this.productPic);
        dest.writeString(this.productDetails);
        dest.writeLong(this.remainCount);
        dest.writeLong(this.totalCount);
        dest.writeDouble(this.price);
        dest.writeDouble(this.fee);
        dest.writeDouble(this.lastPrice);
        dest.writeInt(this.shipmentPosition);
    }

    protected ProductInfo(Parcel in) {
        this.repertoryStatus = in.readString();
        this.productId = in.readString();
        this.name = in.readString();
        this.area = in.readString();
        this.productPic = in.readString();
        this.productDetails = in.readString();
        this.remainCount = in.readLong();
        this.totalCount = in.readLong();
        this.price = in.readDouble();
        this.fee = in.readDouble();
        this.lastPrice = in.readDouble();
        this.shipmentPosition = in.readInt();
    }

    public static final Creator<ProductInfo> CREATOR = new Creator<ProductInfo>() {
        @Override
        public ProductInfo createFromParcel(Parcel source) {
            return new ProductInfo(source);
        }

        @Override
        public ProductInfo[] newArray(int size) {
            return new ProductInfo[size];
        }
    };
}
